import { watch, type Ref } from 'vue';

export function useWatchCharacters<T extends Ref>(
  valueToWatch: T,
  maxChars: number = 100
) {
  watch(valueToWatch, (newValue) => {
    if (newValue.length === maxChars) {
      alert(`only ${maxChars} characters allowed gosh darnit!`);
    }
  });
}
